package be.kul.osgi.ds.capability1;

import java.rmi.RemoteException;

import be.kul.osgi.ds.rmi.RMIConnection;



public class Capa {

	public RMIConnection rmi;
	
	/*
	 * RMIConnection
	 */
	
	public void setRMI(RMIConnection rmi){
		System.out.println("RMIcomponent was set. Thank you DS!");
		this.rmi = rmi;	
		
	}
	
	public void unsetRMI(RMIConnection rmi){
		System.out.println("RMIcomponent was unset. Why did you do this to me?");
		if (this.rmi == rmi) {
			this.rmi = null;
		}	
	}
	
	public void goPickup(String agent, String PackageID, double x, double y){
		this.rmi.goPickup(agent, PackageID, x, y);
	}
	
	public String BusyWith(String Agent){
		return this.rmi.isBusyWith(Agent);
	}
		
	public Long getTime(){
		return this.rmi.getTime();
	}
	
	public double getX(String Agent){
		return this.rmi.getX(Agent);
	}
	
	public double getY(String Agent){
		return this.rmi.getY(Agent);
	}
	
	public boolean getIsLoaded(String Agent){
		return this.rmi.getIsLoaded(Agent);
	}
	
	public boolean isBroken(String Agent){
		return this.rmi.isBroken(Agent);
	}
	
}
